﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OnLineSOList.aspx.cs" Inherits="WMS6.Web.OrderManagement.OnLineSOList" %>
<%@ PreviousPageType VirtualPath="~/OrderManagement/OnLineSOQuery.aspx" %>
<%@ Register Src="../UserControls/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>OnLineSOList</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />
    <script src="../Js/jquery.js" type="text/javascript"></script>
        <script src="../Js/jquery.blockUI.js" type="text/javascript"></script>
    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>
    <script src="../Js/checkbox.js" type="text/javascript"></script>
    <script src="../Js/util.js" type="text/javascript"></script>
    <script src="../Js/InitPage.js" type="text/javascript"></script>
    <base target="_self" /> 
    <script type="text/javascript">
        //初始化页面
        window.onload = function(){
            var action = document.getElementById("hdnActionID").value;
             if(action != null && action != "")
            {
                var array = action.split(',');
                initQueryPage(array[0],array[1]);
            }
            else
            {
                initListPage();
            }
        }
        
        function returnSearch()
        {
            var from = document.getElementById("hdnFrom").value;
            if(from != "")
            {
                window.location.href = "OnLineSOQuery.aspx";
            }
            else
            {
                window.history.go(-1);
            }
        }
        
        function confirmMsg(code)
        {
            if(code == "C001")
            {
                if(confirm('<%=GetGlobalMsgResource("C001") %>'))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }

        }
        
         function showAction()
		{	
			var pos = getElementPos("btnAction");	
			document.getElementById("actionDiv").style.top = pos.y+17;
			document.getElementById("actionDiv").style.left = pos.x;  			
			document.getElementById("hiddenFlag").value = '1';
		}
		
		function hiddenDiv() {
		    var flag = document.getElementById("hiddenFlag").value
		    if (flag == "1") {
		        document.getElementById("actionDiv").style.display = "block";
		        document.getElementById("hiddenFlag").value = '0';
		    }
		    else {
		        document.getElementById("actionDiv").style.display = "none";
		    }
		}
		
		 //锁屏
		function blockScreen()
		{
		    //锁屏
		    $.blockUI.defaults.message = GetBlockUIMsg();
            $.blockUI.defaults.overlayCSS.backgroundColor = GetBlockUIBgColor();
            $.blockUI();
		}
        
    </script>
</head>
<body>
    <form id="F3031" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_List_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblSalesOrder" runat="server" CssClass="label_header" 
                            Text="网上下单" meta:resourcekey="lblSalesOrder" ></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnNew" runat="server" CssClass="button" Text="<%$ Resources:ButtonResource,btnNew %>"
                            Enabled="False" 
                            OnClientClick="javascript:window.location.href='OnLineSO.aspx?from=list';return false;" 
                            meta:resourcekey="btnNew" />
                    </td>
                    <td>
                        <asp:Button ID="btnEdit" runat="server" CssClass="button" Text="<%$ Resources:ButtonResource,btnEdit %>"
                            Enabled="False" OnClick="btnEdit_Click" 
                            meta:resourcekey="btnEdit" />
                    </td>
                    <td>
                        <asp:Button ID="btnDelete" runat="server" CssClass="button" Text="<%$ Resources:ButtonResource,btnDelete %>"
                            OnClientClick="javascript:if(confirmMsg('C001')) return true; else return false;"
                            OnClick="btnDelete_Click" Enabled="False" 
                            meta:resourcekey="btnDelete" />
                    </td>
                    <td>
                        <asp:Button ID="btnRefresh" runat="server" CssClass="button" Text="<%$ Resources:ButtonResource,btnRefresh %>"
                            Enabled="False" meta:resourcekey="btnRefresh" />
                    </td>
                    <td>
                       <input id="btnAction" type="button" runat="server" value="<%$Resources:ButtonResource,btnAction%>"
                            class="button" onclick="showAction(); return false;" />
                    </td>
                    <td>
                        <asp:Button ID="btnReport" runat="server" CssClass="button" Text="<%$ Resources:ButtonResource,btnReport %>"
                            Enabled="False" meta:resourcekey="btnReport" />
                    </td>
                    <td>
                        <asp:Button ID="btnFinish" runat="server" CssClass="button" Text="<%$ Resources:ButtonResource,btnFinish %>"
                            Enabled="False" Visible="False" OnClick="btnFinish_Click" 
                            meta:resourcekey="btnFinish" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="blank8">
        </div>
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div id="div_List">
                    <div id="div_List_msg">
                        <asp:Label ID="lblMsg" runat="server" CssClass="label_message" 
                            meta:resourcekey="lblMsg"></asp:Label>
                    </div>
                    <asp:GridView ID="gvSalesOrder" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                        CssClass="gridview" DataKeyNames="ORDER_ID,STATUS" PageSize="20" Width="1750px"
                        OnRowDataBound="gvSalesOrder_RowDataBound" OnSelectedIndexChanging="gvSalesOrder_SelectedIndexChanging"
                        OnSorting="gvSalesOrder_Sorting" meta:resourcekey="gvSalesOrder" >
                        <FooterStyle CssClass="GridViewFooterStyle" />
                        <RowStyle CssClass="GridViewRowStyle" />
                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                        <Columns>
                            <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="BoundField">
                                <ItemStyle CssClass="GridViewRowWidth_40" />
                            </asp:BoundField>
                            <asp:TemplateField meta:resourcekey="TemplateField">
                                <HeaderTemplate>
                                    <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvSalesOrder');"
                                        meta:resourcekey="CheckBox1" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chbSelect" runat="server" meta:resourcekey="chbSelect" />
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvSalesOrder');"
                                        meta:resourcekey="CheckBox2" />
                                </FooterTemplate>
                                <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="订单号" FooterText="订单号" SortExpression="ORDER_ID" meta:resourcekey="ORDER_ID">
                                <ItemTemplate>
                                    <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("ORDER_ID") %>' NavigateUrl='<%# FormatUrl("~/OrderManagement/OnLineSO.aspx?from=list&ID={0}",Eval("ORDER_ID").ToString()) %>'
                                        Target="_self" CssClass="hyperlink" meta:resourcekey="HyperLink1"></asp:HyperLink>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="OWNER_ID" HeaderText="货主代码" FooterText="货主代码" SortExpression="OWNER_ID"
                                meta:resourcekey="OWNER_ID">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="STATUS_D" HeaderText="状态" FooterText="状态" SortExpression="STATUS_D"
                                meta:resourcekey="STATUS">
                                <ItemStyle CssClass="GridViewRowWidth_150" />
                            </asp:BoundField>
                            <asp:BoundField DataField="TYPE_D" HeaderText="订单类型" FooterText="订单类型" SortExpression="TYPE_D"
                                meta:resourcekey="TYPE">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="CONSIGNEE_ID" HeaderText="客户代码" FooterText="客户代码" SortExpression="CONSIGNEE_ID"
                                meta:resourcekey="CONSIGNEE_ID">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="C_COMPANY" HeaderText="客户名称" FooterText="客户名称" SortExpression="C_COMPANY"
                                meta:resourcekey="C_COMPANY">
                                <ItemStyle CssClass="GridViewRowWidth_200" />
                            </asp:BoundField>
                            <asp:BoundField DataField="EXTERN_ORDER_ID" HeaderText="外部订单号" FooterText="外部订单号" Visible="false"
                                SortExpression="EXTERN_ORDER_ID" meta:resourcekey="EXTERN_ORDER_ID">
                                <ItemStyle CssClass="GridViewRowWidth_150" />
                            </asp:BoundField>
                            <asp:TemplateField FooterText="订单日期" HeaderText="订单日期" SortExpression="ORDER_DATE" >
                                <ItemTemplate>
                                    <asp:Label ID="lblOrderDate" runat="server" Text='<%# GetPreferenceShortDate(Eval("ORDER_DATE").ToString()) %>'
                                        meta:resourcekey="lblOrderDate"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_150" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="要求到货日期" HeaderText="要求到货日期" SortExpression="REQUESTED_DELIVERY_DATE" meta:resourcekey="TemplateFieldResource4">
                                <ItemTemplate>
                                  <asp:Label ID="lblExpectedDeliveryDate" runat="server" Text='<%# (Eval("REQUESTED_DELIVERY_DATE").ToString()!=""? Convert.ToDateTime(Eval("REQUESTED_DELIVERY_DATE")).ToString("yyyy-MM-dd"):"") %>'
                                          meta:resourcekey="lblExpectedDeliveryDate"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_150" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="CREATED_BY" HeaderText="创建人" FooterText="创建人" SortExpression="CREATED_BY"
                                meta:resourcekey="CREATED_BY">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            
                            <asp:TemplateField FooterText="创建日期" HeaderText="创建日期" SortExpression="CREATED_DATE" >
                                <ItemTemplate>
                                    <asp:Label ID="lblCreateDate" runat="server" Text='<%# GetPreferenceShortDate(Eval("CREATED_DATE").ToString()) %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_150" />
                            </asp:TemplateField>
                              <asp:BoundField DataField="SUBMITTED_BY" HeaderText="提交人" FooterText="提交人" SortExpression="SUBMITTED_BY"
                                meta:resourcekey="SUBMITTED_BY">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            
                            <asp:TemplateField FooterText="提交日期" HeaderText="提交日期" SortExpression="SUBMITTED_DATE" >
                                <ItemTemplate>
                                    <asp:Label ID="lblSUBMITTED_DATE" runat="server" Text='<%# GetPreferenceShortDate(Eval("SUBMITTED_DATE").ToString()) %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_150" />
                            </asp:TemplateField>
                            
                        </Columns>
                    </asp:GridView>
                </div>
                <div id="div_pager">
                    <uc1:pager id="PagerFooter" runat="server" onfirst="btnFirst_Click" onprevious="btnPrevious_Click"
                        onnext="btnNext_Click" onlast="btnLast_Click" ongoto="GoTo_Click" />
                </div>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnEdit" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnList" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
        <div id="div_List_bottom">
            <table>
                <tr>
                    <td>
                        <asp:Button ID="btnSearch" runat="server" Text="<%$ Resources:ButtonResource,btnNewSearch %>"
                            CssClass="button" Enabled="False" 
                            OnClientClick="javascript:window.location.href='OnLineSOQuery.aspx';return false;" 
                            meta:resourcekey="btnSearch" />
                    </td>
                    <td>
                        <asp:Button ID="btnReSearch" runat="server" Text="<%$ Resources:ButtonResource,btnReSearch %>"
                            CssClass="button" Enabled="False" 
                            OnClientClick="javascript:returnSearch();return false;" 
                            meta:resourcekey="btnReSearch" />
                    </td>
                    <td>
                        <asp:Button ID="btnList" runat="server" Text="<%$ Resources:ButtonResource,btnList %>"
                            CssClass="button" Enabled="False" OnClick="btnList_Click" 
                            meta:resourcekey="btnList" />
                    </td>
                    <td>
                        <asp:Button ID="btnExport" runat="server" Text="<%$ Resources:ButtonResource,btnExport %>"
                            CssClass="button" Enabled="False" OnClick="btnExport_Click" 
                            meta:resourcekey="btnExport" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="actionDiv" style="background-color: #FFFFFF; position: absolute; display: none;">
        <table width="105" border="0" cellspacing="0" cellpadding="0" id="divcontent_menu2">
            <tr class="bg2" onmouseover="this.className='bg1'" onmouseout="this.className='bg2'">
                <td class="line" id="tdlnkbtnSalesOrderSubmit" runat="server" visible="false">
                    <asp:LinkButton ID="lnkbtnSalesOrderSubmit" runat="server" Text="提交" 
                        onclick="lnkbtnSalesOrderSubmit_Click"  OnClientClick="blockScreen();"  meta:resourcekey="lnkbtnSalesOrderSubmit" ></asp:LinkButton>
                </td>
            </tr>
        </table>
    </div>
    </div>
        <input type="hidden" id="hiddenFlag" />
    <input type="hidden" id="hdnFrom" runat="server" />
    <input type="hidden" id="hdnActionID" runat="server" />
    <input type="hidden" id="hdnRtnValue" runat="server" />
    </div>
    </form>
</body>
</html>
<script language="javascript" type="text/javascript" event="onclick" for="document">
<!--
	hiddenDiv();
//-->
</script>